package chapter_3.message.entity;

public abstract class AbstractMessage {
    private Boolean responseFlag;
    private Boolean inquiryFlag;

    public AbstractMessage(Boolean responseFlag, Boolean inquiryFlag){
        this.responseFlag = responseFlag;
        this.inquiryFlag = inquiryFlag;
    }

    public Boolean getResponseFlag() {
        return responseFlag;
    }

    public void setResponseFlag(Boolean responseFlag) {
        this.responseFlag = responseFlag;
    }

    public Boolean getInquiryFlag() {
        return this.inquiryFlag;
    }

    public void setInquiryFlag(Boolean inquiryFlag) {
        this.inquiryFlag = inquiryFlag;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null){
            return false;
        }
        if(obj == this){
            return true;
        }
        if(getClass() == obj.getClass()){
            AbstractMessage other = (AbstractMessage)obj;
            return inquiryFlag.equals(other.getInquiryFlag())
                    && responseFlag.equals(other.getResponseFlag());
        }
        return false;
    }
}
